<?php
class Admin_CommonController extends Zend_Controller_Action {
	function init(){
		parent::init();
		//验证登陆
		$auth = Zend_Auth::getInstance();
    	if (!$auth->hasIdentity()) { 
            $this->_redirect('admin/login');
        }
		$this->registry=Zend_Registry::getInstance();
      	$this->view=$this->registry['view'];
     	$this->view->baseUrl=BLOG_ROOT_URL;
     	// 站点基本信息
		$this->view->version = $this->registry['version'];
		$this->view->domain = $this->registry['domain'];
		$this->view->sitename = $this->registry['sitename'];
		$this->view->keyword = $this->registry['keyword'];
		$this->view->footword = $this->registry['footword'];
		$this->view->record = $this->registry['record'];
		$this->view->styleurl = $this->view->baseUrl."/public/styles/admin";
		$this->view->adminurl = $this->view->baseUrl."/admin";
		//改变模板文件位置
		$this->view->setScriptPath(APP_DIR.'/views/scripts/admin/index/');
		// 缓存配置
		$frontendOptions = array(
        	'lifeTime' => 120, // 两分钟的缓存生命期
        	'automatic_serialization' => true
        );
        $backendOptions = array(
        	'cache_dir' => "./data/cache/"
        );
        // 取得一个Zend_Cache_Core 对象
    	$this->cache = Zend_Cache::factory('Core','File',$frontendOptions,$backendOptions);
    	$admin = Zend_Auth::getInstance()->getIdentity();
    	
	}

}
?>